package com.kdgc.power;


import com.kdgc.power.gen.*;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.gen.SourceBuilder;
import org.beetl.sql.gen.SourceConfig;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@SpringBootTest
public class CHTest {
    @Resource
    @Qualifier("mainSqlManager")
    private SQLManager sqlManager;


    @Test
    void test01() {
        List<SourceBuilder> sourceBuilder = new ArrayList<>();
        SourceBuilder entityBuilder = new EntitySourceBuilder();
        SourceBuilder mapperBuilder = new MapperSourceBuilder();
        SourceBuilder serviceBuilder = new ServiceSourceBuilder();
        SourceBuilder controllerBuilder = new ControllerSourceBuilder();
        SourceBuilder mdBuilder = new MDSourceBuilder();
        sourceBuilder.add(entityBuilder);
        sourceBuilder.add(mapperBuilder);
        sourceBuilder.add(serviceBuilder);
        sourceBuilder.add(controllerBuilder);
        sourceBuilder.add(mdBuilder);
        SourceConfig config = new SourceConfig(sqlManager, sourceBuilder);
        MavenProject project = new MavenProject("E:/Learn/Java/chess/ch-module", "chess");
        String tableName = "Ch_SQYQ_STEP";
        config.gen(tableName, project);
    }
    @Test
    void test02() {

    }

}
